<template>
    <span v-if="Object.keys(auditState).length !== 0">
        <el-button
            type="primary"
            class="btn-blue"
            @click="audit"
            v-if="auditState.canAudit"
            size="small"
            >审核</el-button
        >
        <!-- <el-button
        type="primary"
        class="btn-blue"
        @click="submitCommit"
        v-if="auditState.canModify"
        size="small"
        >保存并提交</el-button
        >
        <el-button
            type="primary"
            class="btn-blue"
            @click="submit"
            v-if="auditState.canModify"
            size="small"
            >保存</el-button
        > -->
        <el-button
            type="primary"
            class="btn-delete"
            v-if="auditState.canUndoAudit"
            @click="undoAudit"
            size="small"
            >撤回</el-button
        >
        <!-- <el-button
            slot="reference"
            type="primary"
            class="btn-delete"
            @click="deleteData"
            v-if="auditState.canModify"
            size="small"
            >删除</el-button
        > -->
        <el-button
            type="primary"
            class="btn-delete"
            @click="nullify"
            v-if="auditState.canAudit"
            size="small"
            >作废</el-button
        >
    </span>
</template>

<script>
export default {
    props: {
        auditState: {
            type: Object,
            default: function () {
                return {}
            }
        }
    },
    data () {
        return {}
    },
    created () {},
    methods: {
        audit () {
            this.$emit('exas', 'audit')
        },
        undoAudit () {
            this.$emit('exas', 'undoAudit')
        },
        submitCommit () {
            this.$emit('exas', 'submitCommit')
        },
        submit () {
            this.$emit('exas', 'submit')
        },
        nullify () {
            this.$emit('exas', 'nullify')
        },
        deleteData () {
            this.$emit('exas', 'deleteData')
        }
    }
}
</script>

<style lang="sass" scoped></style>
